{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import yt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "yt : [INFO     ] 2016-12-22 10:33:41,113 Loading coordinates\n",
      "yt : [INFO     ] 2016-12-22 10:33:41,114 Loading connectivity\n",
      "yt : [INFO     ] 2016-12-22 10:33:41,124 Parameters: current_time              = 2.0\n",
      "yt : [INFO     ] 2016-12-22 10:33:41,125 Parameters: domain_dimensions         = [1 1 1]\n",
      "yt : [INFO     ] 2016-12-22 10:33:41,126 Parameters: domain_left_edge          = [-0.6 -0.6  0. ]\n",
      "yt : [INFO     ] 2016-12-22 10:33:41,128 Parameters: domain_right_edge         = [ 6.6  6.6  1. ]\n",
      "yt : [INFO     ] 2016-12-22 10:33:41,129 Parameters: cosmological_simulation   = 0\n",
      "yt : [INFO     ] 2016-12-22 10:33:41,137 Loading coordinates\n",
      "yt : [INFO     ] 2016-12-22 10:33:41,138 Loading connectivity\n",
      "yt : [INFO     ] 2016-12-22 10:33:41,269 xlim = -0.600000 6.600000\n",
      "yt : [INFO     ] 2016-12-22 10:33:41,269 ylim = -0.600000 6.600000\n",
      "yt : [INFO     ] 2016-12-22 10:33:41,271 xlim = -0.600000 6.600000\n",
      "yt : [INFO     ] 2016-12-22 10:33:41,272 ylim = -0.600000 6.600000\n",
      "yt : [INFO     ] 2016-12-22 10:33:41,275 Making a fixed resolution buffer of (('connect1', 'group1')) 800 by 800\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "959.3496444727219 dimensionless\n",
      "900.0 dimensionless\n",
      "8.138120750714538 dimensionless\n",
      "8.137864325565221 dimensionless\n",
      "0.8231674445177946 dimensionless\n",
      "0.8230987236017343 dimensionless\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "yt : [INFO     ] 2016-12-22 10:33:41,526 xlim = -0.600000 6.600000\n",
      "yt : [INFO     ] 2016-12-22 10:33:41,527 ylim = -0.600000 6.600000\n",
      "yt : [INFO     ] 2016-12-22 10:33:41,528 xlim = -0.600000 6.600000\n",
      "yt : [INFO     ] 2016-12-22 10:33:41,529 ylim = -0.600000 6.600000\n",
      "yt : [INFO     ] 2016-12-22 10:33:41,531 Making a fixed resolution buffer of (('connect1', 'group2')) 800 by 800\n"
     ]
    }
   ],
   "source": [
    "ds = yt.load(\"gen-mesh-one-material_out.e\", step=-1)\n",
    "\n",
    "ad = ds.all_data()\n",
    "\n",
    "temp = ad[('connect1', 'temp')]\n",
    "group1 = ad['group1']\n",
    "group2 = ad['group2']\n",
    "\n",
    "print(temp.max())\n",
    "print(temp.min())\n",
    "print(group1.max())\n",
    "print(group1.min())\n",
    "print(group2.max())\n",
    "print(group2.min())\n",
    "\n",
    "g1slice = yt.SlicePlot(ds, 'z', 'group1')\n",
    "g2slice = yt.SlicePlot(ds, 'z', 'group2')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<img style=\"max-width:100%%;max-height:100%%;\" src=\"\"><br>"
      ],
      "text/plain": [
       "<yt.visualization.plot_window.AxisAlignedSlicePlot at 0x7fb3c0dd3cc0>"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "g1slice.set_log('group1', False)\n",
    "g1slice.set_zlim('group1', group1.min(), group1.max())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<img style=\"max-width:100%%;max-height:100%%;\" src=\"\"><br>"
      ],
      "text/plain": [
       "<yt.visualization.plot_window.AxisAlignedSlicePlot at 0x7fb3c0dd3780>"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "g2slice.set_log('group2', False)\n",
    "g2slice.set_zlim('group2', group2.min(), group2.max())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "yt : [INFO     ] 2016-12-22 10:35:23,543 Loading coordinates\n",
      "yt : [INFO     ] 2016-12-22 10:35:23,544 Loading connectivity\n",
      "yt : [INFO     ] 2016-12-22 10:35:23,551 Parameters: current_time              = 2.0\n",
      "yt : [INFO     ] 2016-12-22 10:35:23,552 Parameters: domain_dimensions         = [1 1 1]\n",
      "yt : [INFO     ] 2016-12-22 10:35:23,554 Parameters: domain_left_edge          = [-0.6 -0.6  0. ]\n",
      "yt : [INFO     ] 2016-12-22 10:35:23,555 Parameters: domain_right_edge         = [ 6.6  6.6  1. ]\n",
      "yt : [INFO     ] 2016-12-22 10:35:23,557 Parameters: cosmological_simulation   = 0\n",
      "yt : [INFO     ] 2016-12-22 10:35:23,558 Loading coordinates\n",
      "yt : [INFO     ] 2016-12-22 10:35:23,560 Loading connectivity\n",
      "yt : [INFO     ] 2016-12-22 10:35:23,697 xlim = -0.600000 6.600000\n",
      "yt : [INFO     ] 2016-12-22 10:35:23,698 ylim = -0.600000 6.600000\n",
      "yt : [INFO     ] 2016-12-22 10:35:23,699 xlim = -0.600000 6.600000\n",
      "yt : [INFO     ] 2016-12-22 10:35:23,700 ylim = -0.600000 6.600000\n",
      "yt : [INFO     ] 2016-12-22 10:35:23,702 Making a fixed resolution buffer of (('connect1', 'group1')) 800 by 800\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "900.4045415306368 dimensionless\n",
      "900.0 dimensionless\n",
      "8.097011032290823 dimensionless\n",
      "8.097006592146112 dimensionless\n",
      "0.8138626175116652 dimensionless\n",
      "0.8138613746801414 dimensionless\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "yt : [INFO     ] 2016-12-22 10:35:23,956 xlim = -0.600000 6.600000\n",
      "yt : [INFO     ] 2016-12-22 10:35:23,957 ylim = -0.600000 6.600000\n",
      "yt : [INFO     ] 2016-12-22 10:35:23,958 xlim = -0.600000 6.600000\n",
      "yt : [INFO     ] 2016-12-22 10:35:23,959 ylim = -0.600000 6.600000\n",
      "yt : [INFO     ] 2016-12-22 10:35:23,961 Making a fixed resolution buffer of (('connect1', 'group2')) 800 by 800\n"
     ]
    }
   ],
   "source": [
    "ds = yt.load(\"../gen-mesh-one-material_out.e\", step=-1)\n",
    "\n",
    "ad = ds.all_data()\n",
    "\n",
    "temp = ad[('connect1', 'temp')]\n",
    "group1 = ad['group1']\n",
    "group2 = ad['group2']\n",
    "\n",
    "print(temp.max())\n",
    "print(temp.min())\n",
    "print(group1.max())\n",
    "print(group1.min())\n",
    "print(group2.max())\n",
    "print(group2.min())\n",
    "\n",
    "g1slice = yt.SlicePlot(ds, 'z', 'group1')\n",
    "g2slice = yt.SlicePlot(ds, 'z', 'group2')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<img style=\"max-width:100%%;max-height:100%%;\" src=\"\"><br>"
      ],
      "text/plain": [
       "<yt.visualization.plot_window.AxisAlignedSlicePlot at 0x7fb3c43b01d0>"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "g1slice.set_log('group1', False)\n",
    "g1slice.set_zlim('group1', group1.min(), group1.max())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<img style=\"max-width:100%%;max-height:100%%;\" src=\"\"><br>"
      ],
      "text/plain": [
       "<yt.visualization.plot_window.AxisAlignedSlicePlot at 0x7fb3c43812b0>"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "g2slice.set_log('group2', False)\n",
    "g2slice.set_zlim('group2', group2.min(), group2.max())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
